The invention relates to methods, techniques, software and systems for rendering multiple sources of input into a single output.
Software developers currently have a number of tools for designing documents and pieces of data to be returned in response to client requests. These tools include various mark up languages such as HTML(trademark) and XML(trademark), for example. These mark-up languages allow a software developer to program using tags. These mark-up languages may contain many different types of tags, requiring different syntax and/or different parameters and the different tags may have different attributes. Applications such as Cold Fusion(trademark), JSP(trademark) (Java Server Pages) and ASP(trademark) (Active Server Pages) involve programming in tags, known as xe2x80x9ctag-based scriptingxe2x80x9d These mark-up languages and applications require a developer to learn a complete, often complex, tag-related syntax to design a document to be returned in response to a client request. Moreover, developers are limited by the functionality of the tags.
It would be desirable to reduce the complexity of a system to design and render documents and improve the ability of a system to adapt if changes are made in the future, which would reduce the effort for development, maintenance and future enhancements of the system.
According to one aspect, the invention relates to information presentation in a computer system, and deals more particularly with a technique, system, and computer program for applying a polymorphic, inheritance-based approach to render multiple sources of input data into a single output data source. This embodiment provides a methodology for the separation of presentation logic from business logic and data sources.
According to another aspect, the invention provides a computer-readable medium storing computer executable instructions that when loaded in a computer adapts the computer to render a document from: a template which defines a structure for the document, the template comprising zero or more region definitions, each region definition having a region name; zero or more data providers, each data provider comprising one or more regions, each region being associated with a region name, and each data provider being one of either a software data provider and a non-software provider wherein a software data provider provides data resulting from execution of software code and a non-software provider does not provide data resulting from execution of software code; and wherein each region can comprise zero or more further regions and each region can further comprise zero or more further region definitions; by for each region definition in the template: (a) identifying which data providers, if any, are associated with the region name of the region definition; (b) if no data providers are identified in step (a), then returning a default value; otherwise (c) of the data providers identified in step (a), choosing the data providers to be used to provide data in place of the region definition; and (d) generating data from the data providers chosen in step (c) and replacing the region definition in the template with the generated data.
According to yet another aspect, the invention provides a computer-implemented method for creating a document comprising: creating a template defining a structure for the document, the template comprising zero or more region definitions, each region definition having a region name; creating zero or more data providers wherein each data provider comprises one or more regions, each region being associated with a region name; and each data provider is one of either a software data provider and a non-software provider wherein a software data provider provides data resulting from execution of software code and a non-software provider does not provide data resulting from execution of software code; and each region can further comprise zero or more further regions and each region can further comprise zero or more further region definitions; rendering the template, wherein for each region definition in the template, (a) identifying which data providers, if any, are associated with the region name of the region definition; (b) if no data providers are identified in step (a), then returning a default value; otherwise (c) of the data providers identified in step (a), choosing the data providers to be used to provide data in place of the region definition; and (d) generating data from the data providers chosen in step (c) and replacing the region definition in the template with the generated data.
According to yet another aspect, the invention provides a computer system for creating a document, the system comprising input hardware and software for a user to create a template defining a structure of the document, the template comprising zero or more region definitions, each region definition having a region name; and for a user to create zero or more data providers wherein each data provider is associated with one or more region names; a rendering engine and a rendering strategy wherein the combination of the rendering engine and the rendering strategy creates a rendered document by (a) identifying which data providers, if any, are associated with the region name of the region definition; (b) if no data providers are identified in step (a), then returning a default value; otherwise (c) of the data providers identified in step (a), choosing the data providers to be used to provide data in place of the region definition; and (d) generating data from the data providers chosen in step (c) and replacing the region definition in the template with the generated data.
Advantageously, different embodiments of the present invention may permit:
providing a relatively simple technique for rendering input data sources into a single output data source;
providing a rendering technique allowing efficient use of multiple and disparate data sources, such as, for example: plain text documents, HTML documents, XML documents, Software objects, etc;
providing a rendering technique that enables different data retrieval or formatting implementations to be quickly and easily substituted into the computing environment, to quickly adapt to changes in data or formatting requirements, which changes may not currently be foreseeable;
providing a technique that enables new sources of data to be quickly and easily added into a rendering technique, providing greater flexibility in the manner in which the data sources can be rendered, where for example, the new sources or data may override older sources of data, depending upon a rendering strategy;
providing a method for separating presentation logic from business logic and data sources; in other words, a template for a document, for example, may remain the same, even though the logic used to produce data for the template or the data content itself may change;
allowing the separation of dynamic content (eg: information generated through a software method) from static content (eg: a text document) which provides a useful separation of disciplines; such separation of disciplines has several advantages including the ability to distinguish between types of data providers whereby certain types of data providers may be best created or modified by software programmers whereas another type of data provider could be created by anyone, including data entry personnel, whose knowledge of programming techniques would be irrelevant;
providing a polymorphic content replacement algorithm or strategy for selective replacement of data; in other words, such a strategy would allow for, among other things, the ability to change the look and feel of the document to be returned to a client at run time as well as changing the logic used to create the document to be returned;
providing an xe2x80x9cinheritance-basedxe2x80x9d content replacement algorithm by allowing a hierarchical inclusion of regions within regions, which creates increased flexibility and allows for the relatively easy modification or addition of one region within another; and
providing a value replacement algorithm for use across multiple document templates and providers of data for the templates, allowing for global use of variables or placeholders, for example.